package com.chinairi.mall.service;

import com.chinairi.mall.controller.viewobject.UserRegisterVO;
import com.chinairi.mall.controller.viewobject.UserVO;
import com.chinairi.mall.model.SysMenu;
import com.chinairi.mall.model.SysUser;
import com.chinairi.mall.model.SysUserLogin;
import com.baomidou.mybatisplus.extension.service.IService;
import com.chinairi.mall.service.modelobject.SysUserLoginMO;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 用户账号信息表 服务类
 * </p>
 *
 * @author 董志涵
 * @since 2020-08-17
 */
public interface ISysUserLoginService extends IService<SysUserLogin> {
    void insertSysUser(SysUserLogin sysUserLogin);

    SysUserLogin getSysUserByUserMail(String userMail);

    SysUserLogin getSysUserByUserName(String userName);

    //    void changePasswordByUuid(String password,String uuid);

    /**
     * 登录
     * @param response
     * @param request
     * @return
     * @throws Exception
     */
    SysUserLoginMO login(HttpServletResponse response, HttpServletRequest request) throws Exception;

    /**
     * 修改密码，原+现接口
     *
     * @param request
     * @throws Exception
     */
    void changePassword(HttpServletRequest request) throws Exception;

    /**
     * 强制修改密码
     * @param request
     * @throws Exception
     */
    void forceChangePassword(HttpServletRequest request) throws Exception;

    /**
     * 验证手机号
     *
     * @param phoneNumber
     * @param request
     * @return
     */
    String checkPhoneNumberEx(String phoneNumber, HttpServletRequest request);


    /**
     * 忘记密码，4参数接口
     * @param phone
     * @param request
     * @throws Exception
     */
    void forgetPassword(String phone, HttpServletRequest request) throws Exception;

    /**
     * 邮箱验证绑定
     *
     * @param email
     * @param request
     * @return
     */
    String checkMail(String email, HttpServletRequest request);

    /**
     * 用户邮箱绑定
     *
     * @param mail
     * @param request
     */
    void updateMail(String mail, HttpServletRequest request);

    /**
     * 定时更新用户锁定字段
     */
    void updateCheck();


    /**
     * 路由地址
     * @param menuId
     * @return
     */
    List<SysMenu> listPCWebMenu(String menuId);

    /**
     * 校验密码
     * @param request
     * @return
     * @throws Exception
     */
    boolean passwordCheck(HttpServletRequest request) throws Exception;

    /**
     * 获取redis的地区列表
     * @return
     */
    Map<Object, Object> getAreaMapFromRedis();
}
